-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: L1 <> L2 messaging with Token Bridge example #253
base: dev
Are you sure you want to change the base?
Conversation
…ToL2 + implement consumeWithdrawal
@@ -0,0 +1 @@ | |||
src/Vm.sol linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of notes/questions:
- I added tests for the Solidity contracts to ensure correctness, and opted for Foundry for consistency (as we already use it for Starknet contract tests). If you think this adds too many other files (see next point), and don't think they're that necessary for this example, we can delete.
forge-std
library is included in the source, as it makes any extra setup unnecessary to run tests for the SolidityTokenBridge
in the future. Let me know if you want this removed, and we can add a README note with instructions on how to set this up.- I didn't update ./scripts/cairo_programs_verifier.sh to run Solidity tests, but this can be done.
import "starknet/IStarknetMessaging.sol"; | ||
|
||
/** | ||
* @title Contract to bridge tokens to and from Starknet. Has basic access control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you want me to remove some of these comments, I aimed for a contract that respects best dev practices, but not sure if it adds too much clutter to the code on the website.
@0xNeshi The repository has been upgraded to a new site generator and the Markdown format to include code listings is slightly different. The CONTRIBUTING guidelines has been updated to reflect these changes. |
@julio4 updated the branch! Took the liberty to update Scarb.toml examples in CONTRIBUTING.md, I think they were missing the |
Issue(s): Close #186
Description
Adds a simple token bridge example that sends and receives tokens from L1 to L2 and vice versa.
Checklist
./scripts/cairo_programs_verifier.sh
successfullyTokenBridge
: https://sepolia.starkscan.co/contract/0x03b738bfae36b3cbc966954370f74fc3b816f928f8781318b7ef66faf3b381f2MintableTokenMock
: https://sepolia.starkscan.co/contract/0x2d1267d27b3ecab2af7a40dd1f8c3e44d421d6a873c0167991c5c0ae487f435TokenBridge
: https://sepolia.etherscan.io/address/0x7c7bc92832bd8f273c5ad62057d65c006b1a5ad2MintableTokenMock
: https://sepolia.etherscan.io/address/0xCbeF7249faFc05Cbd57ebC7cc3A4EEBf871424A1